package cn.cdeden.system.domain.dto;

import cn.cdeden.common.mybatis.validator.Query;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
* @author
* @date 2020-09-25
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserQueryParam {

    /** 精确 */
    @Query
    private Long userId;

    private Long deptId;

//    @Query(type = Query.Type.INNER_LIKE)
    @Query(blurry = "email,username,nickName")
    private String nickName;

    private Long teamId;

    @Query(propName = "dept_id", type = Query.Type.IN)
    private Set<Long> deptIds = new HashSet<>();

    @Query(blurry = "email,username,nickName")
    private String blurry;

    /** 精确 */
    @Query
    private Boolean enabled;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Query(type = Query.Type.BETWEEN)
    private List<Date> createTime;


    public UserQueryParam(String nickName) {
        this.nickName = nickName;
    }
}
